<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">

	<title>Class LeanCloud\Storage\CookieStorage</title>

	<link rel="stylesheet" href="resources/style.css?c2f33731c1948fbed7c333554678bfa68d4817da">

</head>

<body>
<div id="left">
	<div id="menu">
		<a href="index.html" title="Overview"><span>Overview</span></a>


		<div id="groups">
				<h3>Namespaces</h3>
			<ul>
				<li class="active">
					<a href="namespace-LeanCloud.html">
						LeanCloud<span></span>
					</a>

						<ul>
				<li>
					<a href="namespace-LeanCloud.Engine.html">
						Engine					</a>

						</li>
				<li>
					<a href="namespace-LeanCloud.Operation.html">
						Operation					</a>

						</li>
				<li class="active">
					<a href="namespace-LeanCloud.Storage.html">
						Storage					</a>

						</li>
				<li>
					<a href="namespace-LeanCloud.Uploader.html">
						Uploader					</a>

						</li>
							</ul></li>
			</ul>
		</div>

		<hr>


		<div id="elements">
			<h3>Classes</h3>
			<ul>
				<li class="active"><a href="class-LeanCloud.Storage.CookieStorage.html">CookieStorage</a></li>
				<li><a href="class-LeanCloud.Storage.SessionStorage.html">SessionStorage</a></li>
			</ul>

			<h3>Interfaces</h3>
			<ul>
				<li><a href="class-LeanCloud.Storage.IStorage.html">IStorage</a></li>
			</ul>




		</div>
	</div>
</div>

<div id="splitter"></div>

<div id="right">
<div id="rightInner">
	<form id="search">
		<input type="hidden" name="cx" value="">
		<input type="hidden" name="ie" value="UTF-8">
		<input type="text" name="q" class="text" placeholder="Search">
	</form>

	<div id="navigation">
		<ul>
			<li>
				<a href="index.html" title="Overview"><span>Overview</span></a>
			</li>
			<li>
				<a href="namespace-LeanCloud.Storage.html" title="Summary of LeanCloud\Storage"><span>Namespace</span></a>
			</li>
			<li class="active">
<span>Class</span>			</li>
		</ul>
		<ul>
		</ul>
		<ul>
		</ul>
	</div>

<div id="content" class="class">
	<h1>Class CookieStorage</h1>


	<div class="description">
	<p>Cookie Storage</p>

<p>Persist key value in client (web browser) cookies.</p>

<p>Notes:</p>

<ol>
<li>Since it uses PHP built-in setcookie, set value will fail after headers being sent.</li>
<li>There are limits on number of bytes per cookie, and number of keys per client.</li>
<li>And other caveats with setcookie.</li>
</ol>
	</div>

	<dl class="tree">
		<dd style="padding-left:0px">
<b><span>LeanCloud\Storage\CookieStorage</span></b>			
			 implements 
				<a href="class-LeanCloud.Storage.IStorage.html"><span>LeanCloud\Storage\IStorage</span></a>
			
			
		</dd>
	</dl>








	<div class="info">
		
		
		<b>Namespace:</b> <a href="namespace-LeanCloud.html">LeanCloud</a>\<a href="namespace-LeanCloud.Storage.html">Storage</a><br>
		

				<b>See:</b>
				http://php.net/manual/en/function.setcookie.php<br>
			<b>Located at</b> <a href="source-class-LeanCloud.Storage.CookieStorage.html#5-104" title="Go to source code">LeanCloud/Storage/CookieStorage.php</a>
		<br>
	</div>



	<table class="summary methods" id="methods">
	<caption>Methods summary</caption>
	<tr data-order="__construct" id="___construct">

		<td class="attributes"><code>
			 public 

			
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#___construct">#</a>
		<code><a href="source-class-LeanCloud.Storage.CookieStorage.html#44-59" title="Go to source code">__construct</a>( <span>integer <var>$seconds</var> = <span class="php-num">0</span></span>, <span>string <var>$path</var> = <span class="php-quote">&quot;/&quot;</span></span>, <span>string <var>$domain</var> = <span class="php-keyword1">null</span></span> )</code>

		<div class="description short">
			<p>Initilize cookie storage</p>
		</div>

		<div class="description detailed hidden">
			<p>Initilize cookie storage</p>


				<h4>Parameters</h4>
				<div class="list"><dl>
					<dt><var>$seconds</var></dt>
					<dd>Number of seconds to live</dd>
					<dt><var>$path</var></dt>
					<dd>Cookie path scope</dd>
					<dt><var>$domain</var></dt>
					<dd>Cookie domain scope</dd>
				</dl></div>





		</div>
		</div></td>
	</tr>
	<tr data-order="set" id="_set">

		<td class="attributes"><code>
			 public 

			
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_set">#</a>
		<code><a href="source-class-LeanCloud.Storage.CookieStorage.html#61-72" title="Go to source code">set</a>( <span>string <var>$key</var></span>, <span>mixed <var>$val</var></span>, <span>integer <var>$seconds</var> = <span class="php-keyword1">null</span></span> )</code>

		<div class="description short">
			<p>Set value by key</p>
		</div>

		<div class="description detailed hidden">
			<p>Set value by key</p>


				<h4>Parameters</h4>
				<div class="list"><dl>
					<dt><var>$key</var></dt>
					<dd></dd>
					<dt><var>$val</var></dt>
					<dd></dd>
					<dt><var>$seconds</var></dt>
					<dd>Number of seconds to live</dd>
				</dl></div>

				<h4>Returns</h4>
				<div class="list">
					<br>$this
				</div>




				<h4>Implementation of</h4>
				<div class="list"><code><a href="class-LeanCloud.Storage.IStorage.html#_set">LeanCloud\Storage\IStorage::set()</a></code></div>
		</div>
		</div></td>
	</tr>
	<tr data-order="get" id="_get">

		<td class="attributes"><code>
			 public 

			mixed
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_get">#</a>
		<code><a href="source-class-LeanCloud.Storage.CookieStorage.html#74-85" title="Go to source code">get</a>( <span>string <var>$key</var></span> )</code>

		<div class="description short">
			<p>Get value by key</p>
		</div>

		<div class="description detailed hidden">
			<p>Get value by key</p>


				<h4>Parameters</h4>
				<div class="list"><dl>
					<dt><var>$key</var></dt>
					<dd></dd>
				</dl></div>

				<h4>Returns</h4>
				<div class="list">
					mixed
				</div>




				<h4>Implementation of</h4>
				<div class="list"><code><a href="class-LeanCloud.Storage.IStorage.html#_get">LeanCloud\Storage\IStorage::get()</a></code></div>
		</div>
		</div></td>
	</tr>
	<tr data-order="remove" id="_remove">

		<td class="attributes"><code>
			 public 

			
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_remove">#</a>
		<code><a href="source-class-LeanCloud.Storage.CookieStorage.html#87-94" title="Go to source code">remove</a>( <span>string <var>$key</var></span> )</code>

		<div class="description short">
			<p>Remove key from storage</p>
		</div>

		<div class="description detailed hidden">
			<p>Remove key from storage</p>


				<h4>Parameters</h4>
				<div class="list"><dl>
					<dt><var>$key</var></dt>
					<dd></dd>
				</dl></div>

				<h4>Returns</h4>
				<div class="list">
					<br>$this
				</div>




				<h4>Implementation of</h4>
				<div class="list"><code><a href="class-LeanCloud.Storage.IStorage.html#_remove">LeanCloud\Storage\IStorage::remove()</a></code></div>
		</div>
		</div></td>
	</tr>
	<tr data-order="clear" id="_clear">

		<td class="attributes"><code>
			 public 

			
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_clear">#</a>
		<code><a href="source-class-LeanCloud.Storage.CookieStorage.html#96-103" title="Go to source code">clear</a>( )</code>

		<div class="description short">
			<p>Clear all data in storage</p>
		</div>

		<div class="description detailed hidden">
			<p>Clear all data in storage</p>



				<h4>Returns</h4>
				<div class="list">
					<br>$this
				</div>

				<h4>Throws</h4>
				<div class="list">
					RuntimeException
				</div>



				<h4>Implementation of</h4>
				<div class="list"><code><a href="class-LeanCloud.Storage.IStorage.html#_clear">LeanCloud\Storage\IStorage::clear()</a></code></div>
		</div>
		</div></td>
	</tr>
	</table>


















</div>

	<div id="footer">
		 API documentation generated by <a href="http://apigen.org">ApiGen</a>
	</div>
</div>
</div>
<script src="resources/combined.js"></script>
<script src="elementlist.js"></script>
</body>
</html>
